# -*- coding: utf-8 -*-

from PyQt4 import Qt, QtGui, QtCore

from Ui_FeActor import Ui_FeActor
from GuiUtils import FormEdit

# Форма правки одного актера.

class FeActor(QtGui.QDialog):
    actor = FormEdit.data

    def __init__(self, parent=None, actor=None):
        QtGui.QDialog.__init__(self, parent)

        self.ui = Ui_FeActor()
        self.ui.setupUi(self)

        self.connect(self.ui.btnOk, QtCore.SIGNAL('clicked()'), self.fromScreenToData)
        self.connect(self.ui.btnOk, QtCore.SIGNAL('clicked()'), self, QtCore.SLOT('accept()'))
        self.connect(self.ui.btnCancel, QtCore.SIGNAL('clicked()'), self, QtCore.SLOT('reject()'))

        self.actor = actor

    def defaultValue(self):
        return ""

    def fromScreenToData(self):
        self.actor = self.ui.lineName.text()

    def fromDataToScreen(self):
        self.ui.lineName.setText(self.actor)
